/*
* Copyright (C) 2023 ~ 2033 Ltd.
*
* Author:     helei <2454264168@qq.com>
*
* Maintainer: helei <2454264168@qq.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* General Public License version 3 as published by the Free Software
* Foundation and appearing in the file LICENSE.MIT included in the
* packaging of this file.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ULOOPPALYWIDGET_H
#define ULOOPPALYWIDGET_H

#include "widgets/uwidget.h"

#include <QMap>

/**
* @brief 轮播图
* 主要用来显示图片轮播显示，需要至少5张图片进行切换
*/
class ULoopPalyWidgetPrivate;
class UTKWIDGET_EXPORT ULoopPalyWidget : public UWidget
{
    Q_OBJECT
public:
    explicit ULoopPalyWidget(QWidget* parent = nullptr);
    ~ULoopPalyWidget();

    /**
     * @brief 设置图片列表
     *
     * @param imageList 图片列表
     * @return void
     *   @retval void
     */
    void setImageList(const QList<QImage> &imageList);

    /**
     * @brief 设置最中间图片尺寸大小
     *
     * @param size 图片尺寸大小
     * @return void
     *   @retval void
     */
    void setCenterItemSize(const QSize &size);

public slots:
    /**
     * @brief 向前轮播切换动画
     *
     * @return void
     *   @retval void
     */
    void onForwardAnimation();

    /**
     * @brief 向后轮播切换动画
     *
     * @return void
     *   @retval void
     */
    void onBackwardAnimation();

protected:
    void resizeEvent(QResizeEvent* event) override;

private:
    QScopedPointer<ULoopPalyWidgetPrivate> d_ptr;
    Q_DISABLE_COPY(ULoopPalyWidget)
    Q_DECLARE_PRIVATE_D(d_ptr, ULoopPalyWidget)
};

#endif // ULOOPPALYWIDGET_H
